package com.by.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author LittleDesire
 * @description
 * @date 2022-03-25 周五 19:22
 * @since 17
 */
@Controller
public class app {

    @GetMapping("t1")
    public ModelAndView t1() {
        return new ModelAndView();
    }
    @GetMapping("a1")
    public ModelAndView a1(ModelAndView mv) {
        mv.setViewName("show");
        mv.addObject("user","李昂");
        mv.addObject("addrs", new String[]{"上海", "南京", "巴黎", "桥东"});
        return mv;
    }

    @RequestMapping("home")
    public String home(Model m) {
        m.addAttribute("msg", "登陆成功");
        return "home";
    }
}
